package com.zd.wechatPlatform.common.enums;

/**
 * 微信事件消息-事件类型枚举
 * 
 * @author lishi
 * @date 2018年10月31日 下午5:47:50
 */
public enum WeixinEventTypeEnum {
	subscribe("subscribe", "关注公众号"),
	unsubscribe("unsubscribe", "取消关注公众号"),
	SCAN("SCAN", "扫描二维码"),
	LOCATION("LOCATION", "上传位置信息"),
	CLICK("CLICK", "点击普通菜单"),
	VIEW("VIEW", "点击链接菜单");

	private String key;
	private String value;

	private WeixinEventTypeEnum(String key, String value) {
		this.key = key;
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public static WeixinEventTypeEnum get(String key) {
		for (WeixinEventTypeEnum eventType : WeixinEventTypeEnum.values()) {
			if (eventType.getKey() == key) {
				return eventType;
			}
		}
		return null;
	}
}
